package com.eastfair.venueservice.service.impl;

//import com.baomidou.dynamic.datasource.annotation.DS;
import com.eastfair.boot.service.SuperServiceImpl;
import com.eastfair.constant.BusinessConstant;
import com.eastfair.core.base.R;
import com.eastfair.core.context.ContextUtil;
import com.eastfair.venueservice.dao.HomeBuilderDrawingAuditHistoryMapper;
import com.eastfair.venueservice.entity.HomeBuilderDrawingAuditHistory;
import com.eastfair.venueservice.service.HomeBuilderDrawingAuditHistoryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.Collection;

/**
 * <p>
 * 业务实现类
 * 主场搭建商图纸审核历史
 * </p>
 *
 * @author dqq
 * @date 2023-05-04
 */
@Slf4j
@Service
//@DS("#thread.tenant")
public class HomeBuilderDrawingAuditHistoryServiceImpl extends SuperServiceImpl<HomeBuilderDrawingAuditHistoryMapper, HomeBuilderDrawingAuditHistory> implements HomeBuilderDrawingAuditHistoryService {


    /**
     * 处理逻辑删除相关处理
     *
     * @param modelList 实体
     * @return 是否成功
     */
    @Override
    protected R<Boolean> handlerRemoveByIdsOfLogic(Collection<HomeBuilderDrawingAuditHistory> modelList) {
        modelList.forEach(s -> s.setIsDeleted(BusinessConstant.YES));
        return R.successDef();
    }

    @Override
    protected R<Boolean> handlerSave(HomeBuilderDrawingAuditHistory model) {
        model.setProjectId(ContextUtil.getProjectId());
        model.setSubsystemId(ContextUtil.getSubSystemId());
        return R.successDef();
    }
}
